<?php
    
    include_once("core/functions.php");
    
    if($_SERVER["REQUEST_METHOD"] == "GET")
    {
        if(isset($_REQUEST["search"]))
        {
            $data = Core::searchEvent($_REQUEST["search"]);
            if($data != null)
            {
                for($i=0;$i<count($data);$i++)
                {
                    $onclick = "UTSDK.redirect('viewEvent.php?eventId=".$data[$i]["eventId"]."')";
                    echo "<div class='searchResult' onclick=".$onclick.">"
                    . "Event name: <label id='".$data[$i]["name"].$i."'><b>".$data[$i]["name"]."</b></label></div>";
                }
            }
            else
            {
                echo "Null";
            }
        }
    }


?>